
function getXMLHttpRequest(){
                  var xhr = null;
                  if(window.XMLHttpRequest || window.ActiveXObject){
                        if(window.ActiveXObject){
                                       try{
                                                         xhr = new ActiveXObject("Msxml2.XMLHTTP");
                                                   } catch(e){
                                                                                xhr = new ActiveXObject("Microsoft.XMLHTTP");
                                                                 }
                                        }else{
                                                xhr = new XMLHttpRequest();
                                             }

                        }else{
                                alert("Votre navigateur ne supporte pas XMLHTTPRrequest");
                                                  return null;
                                 }
                         return xhr;
                  }

                
                
                
		function envoyerRequeteEn(form){

                  requeteHttp = getXMLHttpRequest();
                
                  if(requeteHttp == null)
                       {
                          alert("impossible d'utiliser Ajax sur ce navigateur");
                       }
                       else
                       { 
  
                          requeteHttp.open('POST','ajax/getEnse.php',true);
                              requeteHttp.onreadystatechange=function(){
                                      if(requeteHttp.readyState==4 && requeteHttp.status==200)
                                      {
                                          
                                              recevoirReponseEn(requeteHttp);
                                            
                                      }
                              };

                       requeteHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
                       requeteHttp.send('form='+escape(form));
                       }

                     }
                     
		function recevoirReponseEn(requeteHttp)
		{	  
		  document.getElementById("ensei").length=0;               
		 var saisi = requeteHttp.responseText;
                 
                 var reg=/\s\s/i;
				//alert('ici '+requeteHttp.responseText)
                 var t=saisi.split(reg);
              
                 var i=t.length;
                 
                 for (var n=0;n<i;n++)
                     {
                    
					 
  
                        
                          var cr=document.createElement("option");
                          cr.text=t[n];
                          document.getElementById("ensei").add(cr);
                       
                     }	 		 	 
			return;
		}
		
                
		